﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.Master" AutoEventWireup="true" CodeBehind="NhanVien.aspx.cs" Inherits="EC2011_hk1_BT6_1041326_1041337_1041373_1041448.Presentation.NhanVien" Title="Nhân viên" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel  ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="586px" 
                DataSourceID="SqlDataSource1" AllowPaging="True" AutoGenerateRows="False" 
                CellPadding="4" DataKeyNames="EmployeeID" ForeColor="#333333" GridLines="None">
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
                <RowStyle BackColor="#EFF3FB" />
                <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <Fields>
                    <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" 
                        InsertVisible="False" ReadOnly="True" SortExpression="EmployeeID" />
                    <asp:BoundField DataField="LastName" HeaderText="LastName" 
                        SortExpression="LastName" />
                    <asp:BoundField DataField="FirstName" HeaderText="FirstName" 
                        SortExpression="FirstName" />
                    <asp:BoundField DataField="DepartmentID" HeaderText="DepartmentID" 
                        SortExpression="DepartmentID" />
                    <asp:BoundField DataField="Salary" HeaderText="Salary" 
                        SortExpression="Salary" />
                    <asp:BoundField DataField="HireDate" HeaderText="HireDate" 
                        SortExpression="HireDate" />
                    <asp:BoundField DataField="URLPersonalPhoto" HeaderText="URLPersonalPhoto" 
                        SortExpression="URLPersonalPhoto" />
                    <asp:BoundField DataField="Description" HeaderText="Description" 
                        SortExpression="Description" />
                </Fields>
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle BackColor="White" />
            </asp:DetailsView>
          
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:PagingDataConnectionString %>" 
                DeleteCommand="DELETE FROM [Employees] WHERE [EmployeeID] = @EmployeeID" 
                InsertCommand="INSERT INTO [Employees] ([LastName], [FirstName], [DepartmentID], [Salary], [HireDate], [URLPersonalPhoto], [Description]) VALUES (@LastName, @FirstName, @DepartmentID, @Salary, @HireDate, @URLPersonalPhoto, @Description)" 
                SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [DepartmentID], [Salary], [HireDate], [URLPersonalPhoto], [Description] FROM [Employees]" 
                UpdateCommand="UPDATE [Employees] SET [LastName] = @LastName, [FirstName] = @FirstName, [DepartmentID] = @DepartmentID, [Salary] = @Salary, [HireDate] = @HireDate, [URLPersonalPhoto] = @URLPersonalPhoto, [Description] = @Description WHERE [EmployeeID] = @EmployeeID">
                <DeleteParameters>
                    <asp:Parameter Name="EmployeeID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="LastName" Type="String" />
                    <asp:Parameter Name="FirstName" Type="String" />
                    <asp:Parameter Name="DepartmentID" Type="Int32" />
                    <asp:Parameter Name="Salary" Type="Decimal" />
                    <asp:Parameter DbType="Date" Name="HireDate" />
                    <asp:Parameter Name="URLPersonalPhoto" Type="String" />
                    <asp:Parameter Name="Description" Type="String" />
                    <asp:Parameter Name="EmployeeID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="LastName" Type="String" />
                    <asp:Parameter Name="FirstName" Type="String" />
                    <asp:Parameter Name="DepartmentID" Type="Int32" />
                    <asp:Parameter Name="Salary" Type="Decimal" />
                    <asp:Parameter DbType="Date" Name="HireDate" />
                    <asp:Parameter Name="URLPersonalPhoto" Type="String" />
                    <asp:Parameter Name="Description" Type="String" />
                </InsertParameters>
            </asp:SqlDataSource>
          <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
          <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
        </ContentTemplate>
    
    </asp:UpdatePanel>
</asp:Content>
